import API from './constant'
import request from '../utils/request'
//查询分页
export const getMessages = ({page=1,pageSize=5}={})=> request({
  url:API.MESSAGE,
  method:'GET',
  params:{
    page,
    pageSize
  }
})
//单个cid查询
export const getMessagesById = (cid)=> request({
  url:API.MESSAGE+`/${cid}`,
  method:'GET'
  
})
//添加
export const addMessages = (info)=> request({
  url:API.MESSAGE,
  method:'POST',
  data:info
})
//修改
export const updateMessages = (info)=> request({
  url:API.MESSAGE,
  method:'PUT',
  data:info
})
//删除
export const deleteMessages = (_id)=> request({
  url:API.MESSAGE+'/'+_id,
  method:'DELETE',
  
})